package qx.hyj.petrescue.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import qx.hyj.petrescue.entity.Content;

import java.util.List;
import java.util.Map;

@Mapper
public interface ContentMapper extends BaseMapper<Content> {

    @Select("SELECT sendId, COUNT(*) as count FROM content WHERE receiveId=#{sendId} AND isRead = 0 GROUP BY sendId")
  @Results({
          @Result(property = "sendId", column = "sendId"),
          @Result(property = "count", column = "count")
  })
    List<Map<String, Integer>> getNewContentNumber(@Param("sendId") Integer sendId);
}
